package com.lq.demo.demo.mode.timer;

import lombok.extern.slf4j.Slf4j;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimerTask;

/**
 * @Auther: LQ
 * @Date: 2018/10/15 21:22
 * @Description:
 */
@Slf4j
public class DancingRebot extends TimerTask {
    @Override
    public void run() {
        //获取最近一次任务执行时间并格式化
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        log.info("schedule exec  time is {}", simpleDateFormat.format(new Date()));
        log.info("dance  happily");
    }
}
